#include <stdio.h>
#include <math.h>

int main(){
    float a,b,c,d;
    printf("Enter three numbers: ");
    scanf("%f %f %f",&a,&b,&c);
    printf("The equation is: %fx^2+%fx+%f=0\n",a,b,c);
    if(a!=0){
        d=sqrt(b*b-4*a*c);
        if(d>0){
            float x1=(-b+d)/(2*a);
            float x2=(-b-d)/(2*a);
            printf("x1=%.3f x2=%.3f\n",x1,x2);
        }else if(d==0){
            float x=(-b)/(2*a);
            printf("x1=x2=%.3f\n",x);
        }else{
            printf("No real number roots.\n");
        }
    }else{
        printf("Equation error!\n");
    }
    return 0;
}

